Data

## Warning: NAs introduced by coercion to integer range

For our primary dataset on Chinese debt, we used a dataset assembled by Horn, Reinhardt and Trebesch. Fortunately, this dataset was exceedingly clean and well-documented. Conversely, for our dependent variable in our analysis, we created a brand new dataset using text analysis and regex expressions of the matrices of recommendations from the UN Universal Periodic Reviews of China for 2013 and 2018. This was an extensive data cleaning task involving large amounts of regex, reshaping, string, manipulation, and joining. You can find all of this in the text_analysis.R file in our repo.

As an exploration of how chinese development finance evolved through time, we can look at the following graph. We see that initially Asia was the main recipient of chinese finance, but Africa took off after 2008.

## `summarise()` has grouped output by 'year'. You can override using the `.groups` argument.

Overall, the global debt to chine has been rising in the past 15 years. Nonetheless, its average growth rate has slowed down dramatically:

At the same time, it is worth noting that the chinese investment in Africa stands out when we consider China’s trade evolution through time. Naturally, the region in which China trades most is Asia.

## Warning in countrycode(sourcevar = trade_debt$country, origin = "country.name", : Some values were not matched unambiguously: Areas, nes, Bonaire, Br. Virgin Isds, Curaçao, FS Micronesia, LAIA, nes, Neth. Antilles, North America and Central America, nes, Oceania, nes, Other Africa, nes, Other Asia, nes, Other Europe, nes, Serbia and Montenegro
## `summarise()` has grouped output by 'continent'. You can override using the `.groups` argument.

In the following map, we can observe the geographical evolution of both trade and debt to China:

shinyApp(
ui <- fluidPage(
  fluidRow(
    column(width = 12,
           align = "center",
           tags$h1("Financial and trade flows with China in the developing world", 
                   tags$style('head { face: bold }'))
    )
  ), 
  fluidRow(
    column(width = 12,
           align = "center",
           sidebarLayout(
             sidebarPanel(
               selectInput(inputId = "variable",
                           label = "Select a variable to visualize",
                           choices = c("Debt to china as percentage of GDP", 
                                       "Imports from China", 
                                       "Exports to China")),
               sliderInput(inputId = "date", 
                           label = "Date:", 
                           min = 2000, 
                           max = 2017, 
                           value = 2017)),
             mainPanel(
               plotOutput("map", 
                          width = "100%")
             ), fluid = TRUE
           )
    )
  )
),

server <- function(input, output) {
  
  data <- reactive({
    mapamundi %>% 
      filter(year == input$date) 
  })

  output$map <- renderPlot({
    ggplot() +
      geom_sf(data = world) +
      geom_sf(data = data(), aes(fill = { if (input$variable == "Debt to china as percentage of GDP") {
        china_debt_gdp 
      } else if (input$variable == "Imports from China") {
        Export
      } else if (input$variable == "Exports to China") {
        Import
      }}), alpha = 3/5) +
      labs(title = "", 
           fill = "",
           caption = "Source: sonnet") +
      theme_minimal() +
      theme(axis.text.x = element_blank(), 
            axis.text.y = element_blank(),
            plot.caption = element_text(size = 12)) +
      guides(color = FALSE, 
             alpha = FALSE,
             fill = guide_colorbar(barwidth = 0.5, 
                                   barheight = 10, title.position = "left",
                                   title.theme = element_text(angle = 90),
                                   title.hjust = .5))
   
  },height = 600, width = 600)
  }
)

Shiny applications not supported in static R Markdown documents

But what is the composition of Chinese finance? In the following interactive chart, we can observe the total amount of USD commited in development projects per type:

## Warning: NAs introduced by coercion to integer range
## `summarise()` has grouped output by 'recipient_region'. You can override using the `.groups` argument.

At the same time, we can see where are each of the projects going. In this graph, we get a sense of the share of finance each region receives per sector: